#include "ConnQueue.h"

SafeQueue<int>* ConnQueue::_sockfdQueue = NULL;
pthread_mutex_t ConnQueue::_mutex = PTHREAD_MUTEX_INITIALIZER;

SafeQueue<int>* ConnQueue::Instance()
{
    if (_sockfdQueue == NULL)
    {
        pthread_mutex_lock(&_mutex);
        if (_sockfdQueue == NULL)
        {
            _sockfdQueue = new SafeQueue<int>(100);
        }
        pthread_mutex_unlock(&_mutex);
    }
    return _sockfdQueue;
}
